package com.youxin.foundation.mq.kafka;

import java.util.Arrays;
import java.util.List;

/**
 * Kafka配置文件
 * @author yingde.cao
 *
 */
public class KafkaConfigBean {

	private String servers;
	private String topics;
	private String groupId;
	private int acks;
	private int retries;

	public String getServers() {
		return servers;
	}

	public void setServers(String servers) {
		this.servers = servers;
	}

	public int getAcks() {
		return acks;
	}

	public void setAcks(int acks) {
		this.acks = acks;
	}

	public int getRetries() {
		return retries;
	}

	public void setRetries(int retries) {
		this.retries = retries;
	}

	public String getTopics() {
		return topics;
	}

	public void setTopics(String topics) {
		this.topics = topics;
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}
	
	public List<String> getServerList()
	{
		if(servers==null){
			return null;
		}
		String[] serversArray=servers.split(",", 0);
		return Arrays.asList(serversArray);
	}
	
	public List<String> getTopicsList()
	{
		if(topics==null){
			return null;
		}
		String[] topicsArray=topics.split(",", 0);
		return Arrays.asList(topicsArray);
	}
}
